#include <stdio.h>
#include "../../lib/util/convert.h"


void dec_2_hex_big(int dec, char* hex, int hex_len) {
    int i = 0;
    for (; (i < 4) && (i < hex_len); i++) {
        *(hex + 4 - 1 -i) = (char) (dec >> 8 * i & 0xFF);
    }
}


int get_int_big_byte(char* bytes, int len) {
    int iOutcome = 0;
    int i = 0;
    char bLoop;
    for (; i < len; i++) {
        bLoop = *(bytes + i);
        iOutcome += (bLoop & 0xFF) << (8 * (len - 1-i));
    }
    return iOutcome;
}
